package com.vin.java.thread.examples;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import java.util.concurrent.Future;

@Service
@Slf4j
public class AsyncService {
    @Async
    public Future<String> asyncSay(int num){

        log.info(Thread.currentThread().getName()+"看");

        return new AsyncResult<>("hi"+num);
    }
}
